#include<bits/stdc++.h>
#define int long long 
using namespace std;

inline int read() {
	int x = 0, f = 0; char ch = getchar();
	while(ch < '0' or ch > '9') f |= (ch == '-'), ch = getchar();
	while(ch >= '0' and ch <= '9') x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}
int __stk[128], __top;
inline void write(int x) {
    if(x < 0) putchar('-'), x = -x;
	do { __stk[++__top] = x % 10, x /= 10; } while(x);
	while (__top) putchar(__stk[__top--] + '0');
}
bool stmer;
const int N = 2e5 + 10, M = 30;
struct node {
    int a, b;
    node operator ^ (const node &p) const {
        return {a ^ p.a, b ^ p.b};
    }
} p1[M], p2[M];
int n, L;
void insert2(node l) {
    for(int i = M - 1; i + 1; i--) if(l.b >> i & 1) {
        if(!p2[i].b) return p2[i] = l, void();
        l = l ^ p2[i];
    }
}
void insert1(node l) {
    for(int i = M - 1; i + 1; i--) if(l.a >> i & 1) {
        if(!p1[i].a) return p1[i] = l, void();
        l = l ^ p1[i];
    } insert2(l);
}

bool edmer;
signed main() {
	freopen("lock.in", "r", stdin);
	freopen("lock.out", "w", stdout);
	cerr << "[Memory] " << (&stmer - &edmer) / 1024 / 1024 << " MB\n";
	n = read(), L = read();
    for(int i = 1; i <= n; i++) {
        node l = {read(), read()};
        insert1(l);
    }
    for(int i = 0; i < M; i++) if(p1[i].a) {
        for(int j = i + 1; j < M; j++) if(p1[j].a >> i & 1) p1[j] = p1[j] ^ p1[i];
        insert2(p1[i]);
    } node l = {0, 0};
    for(int i = M - 1; i + 1; i--) if(!(l.b >> i & 1)) {
        if(!p2[i].b) continue;
        if((l.a ^ p2[i].a) <= L) l = l ^ p2[i];
    }
    write(l.b);
    cerr << "[Runtime] " << (double) clock() / CLOCKS_PER_SEC << " seconds";
	return 0;
} 